import React from "react";
import "../1.css";
export default function Navbar(props) {
  let handleClick = (index) => {
    props.event(index);
  };
  return (
    <div className="navbar">
      <ul>
        {props.navList.map((item, index) => (
          <li
            onClick={() => {
              handleClick(index);
            }}
            className={props.current == index ? "active" : ""}
          >
            {item.name}
          </li>
        ))}
      </ul>
    </div>
  );
}
